package com.summer.JUnit;

import junit.framework.TestCase;

public class TestLargest extends TestCase{

	public void testSimple(){
		assertEquals(9, Largest.largest(new int[]{7,8,9}));
	}
	
	public void testOrder(){
		assertEquals(9, Largest.largest(new int[]{9,8,7}));
		assertEquals(9, Largest.largest(new int[]{7,9,8}));
		assertEquals(9, Largest.largest(new int[]{7,8,9}));
	}
	
	public void testDups(){
		assertEquals(9, Largest.largest(new int[]{9,7,8,9}));
	}
	
	public void testOne(){
		assertEquals(1, Largest.largest(new int[]{1}));
	}
	
	public void testNegative(){
		assertEquals(-7, Largest.largest(new int[]{-7,-8,-9}));
	}
	
	public void testEmpty(){
		try{
			Largest.largest(new int[]{});
			fail("Should have throw an exception");
		}catch(Exception e){
			assertTrue(true);
		}
	}
}
